package correct.day9;

public class Test3 {

    public static boolean IsContinuous (int[] numbers)
    {
        boolean[] hash = new boolean[14];
        int maxVal = 0, minVal = 14;
        for(int x : numbers)
        {
            if(x != 0)
            {
                if(hash[x])
                    return false;
                hash[x] = true;
                maxVal = Math.max(maxVal, x);
                minVal = Math.min(minVal, x);
            }
        }
        return maxVal - minVal <= 4;
    }

    public static void main(String[] args) {
        int[] numbers = {6,0,2,0,4};
        System.out.println(IsContinuous(numbers));
    }
}
